package com.szxy.hotel.mapper;

import com.szxy.hotel.entity.Client;
import org.apache.ibatis.annotations.*;

@Mapper
public interface ClientMapper {

    @Select("select * from client where client_name = #{userName}")
    @ResultMap("ClientResultMap")
    Client findByclientname(@Param("userName") String userName);

    @Insert("insert into client (client_name,client_phone,client_identity,client_money) values(#{userName},#{phone},#{identity},#{money})")
    @ResultMap("ClientResultMap")
    int insertClient(@Param("userName") String userName,@Param("identity") String identity,@Param("money") Double money,@Param("phone") String phone);

    @Update("update client set client_money = #{money} where client_name = #{userName}")
    @ResultMap("ClientResultMap")
    int updateClient(@Param("userName") String userName,@Param("money") Double money);
}